package main
import(
	"fmt"
)

func main(){
  //定义二维数组
  var arr = [3][3]int{{1,4,7},{6,8,9},{2,4,6}}
  fmt.Println(arr)
  fmt.Println("-----------")
  //方式1：for循环
  for i := 0;i < len(arr);i++{
    for j := 0;j < len(arr[i]);j++{
      fmt.Print(arr[i][j],"\t")
    }
    fmt.Println()
  }
  fmt.Println("-----------")
  //方式2：for range循环
  for k,v := range arr {
    for k1,v1 := range v {
      fmt.Printf("arr[%v][%v]=%v\t",k,k1,v1)
    }
    fmt.Println()
  }
}